package com.winit.schedule.task.tracker;

import java.util.HashSet;
import java.util.Set;

import com.winit.schedule.core.event.Dispatcher;
import com.winit.schedule.core.task.ScheduleTaskDefine;
import com.winit.schedule.task.tracker.monitor.ExpireTaskRunnerMonitor;
import com.winit.schedule.task.tracker.monitor.HeartbeatMonitor;
import com.winit.schedule.task.tracker.monitor.ZKServiceMonitor;
import com.winit.schedule.task.tracker.quartz.QuartzScheduleService;
import com.winit.schedule.task.tracker.remoting.RemotingClientService;
import com.winit.schedule.task.tracker.service.RPCRetryService;

public class TaskTrackerContextImpl implements TaskTrackerContext {

    private Dispatcher              dispatcher;

    private TaskTracker             taskTracker;

    private RemotingClientService   remotingClientService;

    private HeartbeatMonitor        heartbeatMonitor;

    private ExpireTaskRunnerMonitor expireTaskRunnerMonitor;

    private Set<ScheduleTaskDefine> taskDefines = new HashSet<ScheduleTaskDefine>();

    private QuartzScheduleService   quartzScheduleService;

    private ZKServiceMonitor        zkServiceMonitor;

    private RPCRetryService         rpcRetryService;

    public TaskTrackerContextImpl(){

    }

    @Override
    public Dispatcher getDispatcher() {
        return dispatcher;
    }

    public void setDispatcher(Dispatcher dispatcher) {
        this.dispatcher = dispatcher;
    }

    @Override
    public TaskTracker getTaskTracker() {
        return taskTracker;
    }

    public void setTaskTracker(TaskTracker taskTracker) {
        this.taskTracker = taskTracker;
    }

    @Override
    public RemotingClientService getRemotingClientService() {
        return remotingClientService;
    }

    public void setRemotingClientService(RemotingClientService remotingClientService) {
        this.remotingClientService = remotingClientService;
    }

    public void setHeartbeatMonitor(HeartbeatMonitor heartbeatMonitor) {
        this.heartbeatMonitor = heartbeatMonitor;
    }

    @Override
    public HeartbeatMonitor getHeartbeatMonitor() {
        return heartbeatMonitor;
    }

    public Set<ScheduleTaskDefine> getTaskDefines() {
        return taskDefines;
    }

    public void setTaskDefines(Set<ScheduleTaskDefine> taskDefines) {
        this.taskDefines = taskDefines;
    }

    public ExpireTaskRunnerMonitor getExpireTaskRunnerMonitor() {
        return expireTaskRunnerMonitor;
    }

    public void setExpireTaskRunnerMonitor(ExpireTaskRunnerMonitor expireTaskRunnerMonitor) {
        this.expireTaskRunnerMonitor = expireTaskRunnerMonitor;
    }

    public QuartzScheduleService getQuartzScheduleService() {
        return quartzScheduleService;
    }

    public void setQuartzScheduleService(QuartzScheduleService quartzScheduleService) {
        this.quartzScheduleService = quartzScheduleService;
    }

    public ZKServiceMonitor getZkServiceMonitor() {
        return zkServiceMonitor;
    }

    public void setZkServiceMonitor(ZKServiceMonitor zkServiceMonitor) {
        this.zkServiceMonitor = zkServiceMonitor;
    }

    public RPCRetryService getRpcRetryService() {
        return rpcRetryService;
    }

    public void setRpcRetryService(RPCRetryService rpcRetryService) {
        this.rpcRetryService = rpcRetryService;
    }

}
